/**
 * 
 */
package net.cloudcodex.client.character.view;


import net.cloudcodex.client.character.view.CharactersView.Message;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DecoratedPopupPanel;
import com.google.inject.Inject;

/**
 * @author Daniel
 * 
 */
public class CharacterDescriptionPopupViewImpl extends DecoratedPopupPanel
		implements CharacterDescriptionPopupView {
	
	private Button cancelButton = new Button();
	private Message message;
	
	@Inject
	public CharacterDescriptionPopupViewImpl(Message message) {
		this.message = message ;
	}
	
	@Override
	public void showPopup() {
		
		this.setGlassEnabled(true);
		this.clear();
		this.center();
		this.show();
		cancelButton.setText(message.getCancelButton());
	}

	@Override
	public void addCharacterDescriptionView(CharacterDescriptionView view) {
		view.addCancelButton(cancelButton);
		this.add(view);
	}

	@Override
	public HasClickHandlers getCancelButton() {
		return this.cancelButton;
	}

}
